package com.ruoyi.common.core.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import java.util.Date;
import java.util.Map;

@Data
public class JhBaseEntity {

    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long jhId;

    /**
     * 乐观锁
     */
    //@Version
    @Excel(name = "乐观锁")
    @TableField(value = "JH_REVISION", fill = FieldFill.INSERT)
    private Integer jhRevision;

    /**
     * 创建人
     */
    @TableField(value = "JH_CREATED_BY", fill = FieldFill.INSERT)
    @Excel(name = "创建人")
    private String jhCreatedBy;

    /**
     * 创建时间
     */
    @TableField(value = "JH_CREATED_TIME", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date jhCreatedTime;

    /**
     * 更新人
     */
    @TableField(value = "JH_UPDATED_BY", fill = FieldFill.INSERT_UPDATE)
    @Excel(name = "更新人")
    private String jhUpdatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "JH_UPDATED_TIME", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date jhUpdatedTime;

    /**
     * 删除标志
     * 不用 int 与 boolean 的原因是写sql时 boolean与空值 的自动转换比较麻烦
     */
    @TableField(value = "JH_DELETED", fill = FieldFill.INSERT)
    private String jhDeleted = "0";

}
